<?php

include_once dirname(dirname(__FILE__)) . '/include/common.php';
$fb_name = isset($_POST["fb_name"]) ? addslashes(trim($_POST["fb_name"])) : '';
$core = new core();
if ($fb_name == "") {
    echo json_encode(array('type' => 1, 'msg' => "Vui lòng điền tên FB!"));
    die;
} else {
    $data_customer = $core->getCustomerInfoByFbName($fb_name);
    if ($data_customer) {
       $html='';
       foreach($data_customer as $customer){
           $html.='<li  class="list_fb_name" rel="'.$customer->phone.'"><a href="javascript:void(0)">'.$customer->facebook_name.'</a></li>';
       }
        echo json_encode(array('type' => 0, 'html' => $html));
        die;
    } else {
        echo json_encode(array('type' => 1, 'msg' => "Không tìm thấy khách hàng!"));
        die;
    }
}
?>